<?php
/**
 * This file is part of PHPlaza (http://code.google.com/p/phplaza)
 * This file is licensed under the GNU Lesser General Public License
 *      http://www.gnu.org/licenses/lgpl.html
 *
 * No warranty is given, express or implied. Use at your own risk.
 */

namespace core::services::render::html;
use core::services as services;
use core::components as comp;
class Page extends HTMLRenderer
{
	public function render()
	{
		$this->service->addData('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
		$this->service->addData('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">');
		
		// TODO: how do we know what to render to the head-tag?
		
		$this->service->addData('<body>');

		$service = core::services::ServiceRegistrator::getInstance();
		$service = $service->getRenderService();		
		foreach($this->component->getChildren() as $child)
		{
			$service->getRenderer($child)->render();
		}
		
		$this->service->addData('</body>');
		$this->service->addData('</html>');
	}
}